package game.module.hall.logic;

import java.util.concurrent.TimeUnit;

import javax.sql.DataSource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import game.HallServer;
import game.db.DataSourceManager;
import game.module.hall.bean.SettingBean;
import game.module.hall.dao.SettingDao;

public class SettingDaoHelper {

private static Logger logger = LoggerFactory.getLogger(SettingDaoHelper.class);
	
	static class SingletonHolder {
		static SettingDaoHelper instance = new SettingDaoHelper();
	}
	
	public static SettingDaoHelper getInstance() {
		return SingletonHolder.instance;
	}
	
	
	
	public void asyncAddSetting(final SettingBean settingBean) {
		HallServer.executorService.execute(new Runnable() {
			
			@Override
			public void run() {
				SettingDao.getInstance().addSetting(settingBean);
				
			}
		});
	}
	
	public void asyncUpdateSetting(final SettingBean settingBean) {
		HallServer.executorService.execute(new Runnable() {
			
			@Override
			public void run() {
				SettingDao.getInstance().updateSetting(settingBean);
				
			}
		});
	}
	
}
